import { ReadFile } from '../../src/renderer/utils/tool'

export async function Login({ commit, rootState }, form) {
  const jsonData = ReadFile();

  if (jsonData.account === form.username && jsonData.password === form.password) {
    return true
  } else {
    return false
  }
}

export async function LogOut({ commit, state }) {
  commit('SET_TOKEN', '');
  commit('SET_USERINFO', {
    name: ''
  });
  return;
}